package com.ruoyi.device.service.impl;

import com.ruoyi.device.domain.DeviceInfo;
import com.ruoyi.device.mapper.DeviceInfoMapper;
import com.ruoyi.device.service.IDeviceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @auth
 * @date
 */
@Service
public class DeviceInfoServiceImpl implements IDeviceInfoService {

    @Autowired(required = false)
    private DeviceInfoMapper deviceMapper;

    /**
     * 获取设备信息详情
     * @param id
     * @return
     */
    @Override
    public DeviceInfo getDeviceById(Long id) {
        return deviceMapper.selectDeviceById(id);
    }

    /**
     * 获取设备信息列表
     * @param params
     * @return
     */
    @Override
    public List<DeviceInfo> getDeviceList(DeviceInfo params) {
        return deviceMapper.selectDeviceList(params);
    }

    /**
     * 新增设备信息
     * @param device
     * @return
     */
    @Override
    public int addDevice(DeviceInfo device) {
        return deviceMapper.insertDevice(device);
    }
    /**
     * 修改设备信息
     * @param device
     * @return
     */
    @Override
    public int editDevice(DeviceInfo device) {
        return deviceMapper.updateDevice(device);
    }
    /**
     * 批量删除设备信息
     * @param ids
     * @return
     */
    @Override
    public int removeDeviceByIds(Long[] ids) {
        return deviceMapper.deleteDeviceByIds(ids);
    }


}
